<div class="layui-card-header layui-card">
    <span class="layui-breadcrumb" lay-filter="breadcrumb">
        <a lay-href="">首页</a>
        <a><cite>基本资料</cite></a>
    </span>
</div>
<style>
    .layui-form-label {
        width:15% !important;
        margin-left:1%;
    }
    .layui-input-inline {
        width: 33% !important;
    }
</style>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li class="layui-this">基本资料</li>
            </ul>
            <div class="layui-tab-content">
                <form class="layui-form layui-form-pane">
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户ID</label>
                        <div class="layui-input-inline">
                            <input type="text" id="userId" disabled="disabled" class="layui-input">
                        </div>
                        <label class="layui-form-label">登录名</label>
                        <div class="layui-input-inline">
                            <input type="text" id="userName" disabled="disabled" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户昵称</label>
                        <div class="layui-input-inline">
                            <input type="text" id="nickName" disabled="disabled" class="layui-input">
                        </div>
                        <label class="layui-form-label">邮箱</label>
                        <div class="layui-input-inline">
                            <input type="text" id="email" disabled="disabled" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">手机号</label>
                        <div class="layui-input-inline">
                            <input type="text" id="mobile" disabled="disabled" class="layui-input">
                        </div>
                        <label class="layui-form-label">用户状态</label>
                        <div class="layui-input-inline">
                            <input type="text" id="status" disabled="disabled" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <a class="layui-btn backBtn" lay-href="" >返回</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['table','util','admin', 'form'], function(){
        var table = layui.table
        ,$ = layui.$
        ,form = layui.form
        ,admin = layui.admin
        ,element = layui.element;

        element.render('breadcrumb', 'breadcrumb');//渲染导航信息

        admin.req({
            type: 'get',
            url: layui.setter.baseUrl + '/current',
            error: function(err){
                layer.alert(err, { title: '请求失败'})
            },
            success: function(res){
                if(res.code == 0 && res.data != null){
                    $('#userId').val(res.data.userId);
                    $('#userName').val(res.data.userName);
                    $('#nickName').val(res.data.nickName);
                    $('#email').val(res.data.email);
                    $('#mobile').val(res.data.mobile);
                    $('#status').val(res.data.status=="0"?"停止使用":"使用中");
                    $('#lastPasswordResetTime').val( layui.util.toDateString(res.data.lastPasswordResetTime));
                }else {
                    layer.alert(res.msg,{title:'请求成功，获取数据为空'})
                }
            }
        })
       
    })
</script>